package com.ruoyi.know.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.TreeEntity;

/**
 * 用户评论对象 user_comments
 *
 * @author ruoyi
 * @date 2025-02-03
 */
public class UserComments implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 评论id */
    private Long commentId;

    /** 父级评论id */
    private Long pCommentId;

    /** 业务id */
    private Long infoId;

    /** 评论类型：1知识点2笔记 */
    @Excel(name = "评论类型：1知识点2笔记")
    private Long commentType;

    /** 评论内容 */
    @Excel(name = "评论内容")
    private String content;

    private SysUser author;

    /** 评论人 */
    private Long userId;

    // 新增子评论集合
    private List<UserComments> children;

    // getter和setter
    public List<UserComments> getChildren() {
        return children;
    }

    public void setChildren(List<UserComments> children) {
        this.children = children;
    }

    /** 评论时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "评论时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createAt;

    public void setCommentId(Long commentId)
    {
        this.commentId = commentId;
    }

    public Long getCommentId()
    {
        return commentId;
    }
    public void setpCommentId(Long pCommentId)
    {
        this.pCommentId = pCommentId;
    }

    public Long getpCommentId()
    {
        return pCommentId;
    }
    public void setInfoId(Long infoId)
    {
        this.infoId = infoId;
    }

    public SysUser getAuthor() {
        return author;
    }

    public void setAuthor(SysUser author) {
        this.author = author;
    }

    public Long getInfoId()
    {
        return infoId;
    }
    public void setCommentType(Long commentType)
    {
        this.commentType = commentType;
    }

    public Long getCommentType()
    {
        return commentType;
    }
    public void setContent(String content)
    {
        this.content = content;
    }

    public String getContent()
    {
        return content;
    }
    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }
    public void setCreateAt(Date createAt)
    {
        this.createAt = createAt;
    }

    public Date getCreateAt()
    {
        return createAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("commentId", getCommentId())
            .append("pCommentId", getpCommentId())
            .append("infoId", getInfoId())
            .append("commentType", getCommentType())
            .append("content", getContent())
            .append("userId", getUserId())
            .append("createAt", getCreateAt())
            .toString();
    }
}
